package com.fivezerotwo.springbootserver.common.ReturnModel;

import com.alibaba.fastjson.JSON;

import java.io.Serializable;

/**
 * 通用返回model
 * Created by qiqi on 2018/7/25 22:02
 */
public class Result implements Serializable {
    private static final long serialVersionUID = -8739044737840031446L;

    private int code;
    private String message;
    private Object data;


    public int getCode() {
        return code;
    }

    public Result setCode(ReturnCode code) {
        this.code = code.getCode();
        return this;
    }

    public String getMessage() {
        return message;
    }

    public Result setMessage(String message) {
        this.message = message;
        return this;
    }

    public Object getData() {
        return data;
    }

    public Result setData(Object data) {
        this.data = data;
        return this;
    }
    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
